package com.users.rn.kit.bridge.impl.im

import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactMethod
import com.facebook.react.bridge.ReadableMap
import com.users.rn.kit.RNKitManager
import com.users.rn.kit.bridge.RNBasicJavaModule

/**

 * 作者：wolf on 1/11/21 11:19

 * 邮箱：bluce

 */

class IMBridge constructor(context: ReactApplicationContext) :
    RNBasicJavaModule<KitImModule>(context) {
    override fun getBridge(): KitImModule? {
        return RNKitManager.get(KitImModule.RN_MODULE_NAME)
    }

    override fun getName(): String {
        return IMBridge::class.java.simpleName
    }

    @ReactMethod
    fun sendMessage(message: ReadableMap, promise: Promise) {
        rnBridge?.sendMessage(context, message, promise)
    }

    @ReactMethod
    fun getRoamingMessageList(params: ReadableMap,promise: Promise){
        rnBridge?.getRoamingMessageList(context,params,promise)
    }


}